ramp calculation